{extend name="public:default" /}

<!-- 搜索栏 -->
{block name="inputBtn"}

    <div class="layui-inline marSelect">
        <div class="layui-input-inline">
        <select name="agency_user_is_show">
            <option value="">是否显示</option>
            <option value="1">显示</option>
            <option value="0">隐藏</option>
        </select>
        </div>
    </div>

    <div class="layui-inline marSelect">
        <div class="layui-input-inline">
        <select name="agency_user_check">
            <option value="">审核状态</option>
            <option value="0">审核中</option>
            <option value="1">审核未通过</option>
            <option value="2">审核通过</option>
        </select>
        </div>
    </div>
    
    <br>

    <div class="layui-inline">
        <fieldset class="label_title">
            <legend>上级昵称</legend>
            <input type="text" name="agency_user_p_nickname" placeholder="点此输入" autocomplete="off" class="layui-input">
        </fieldset>
    </div>

    <div class="layui-inline">
        <fieldset class="label_title">
            <legend>代理昵称</legend>
            <input type="text" name="agency_user_nickname" placeholder="点此输入" autocomplete="off" class="layui-input">
        </fieldset>
    </div>

    <div class="layui-inline">
        <fieldset class="label_title">
            <legend>代理账号</legend>
            <input type="text" name="agency_user_name" placeholder="点此输入" autocomplete="off" class="layui-input">
        </fieldset>
    </div>

    <div class="layui-inline">
        <fieldset class="label_title">
            <legend>代理邀请码</legend>
            <input type="text" name="agency_user_code" placeholder="点此输入" autocomplete="off" class="layui-input">
        </fieldset>
    </div>

    <div class="layui-inline">
        <fieldset class="label_title">
            <legend>请选择日期</legend>
            <input type="text" name="agency_user_times" placeholder="点此选择" class="layui-input" id="test-laydate-range-datetime" lay-key="1" readonly>
        </fieldset>
    </div>
    
{/block}

<!-- 头工具栏 -->
{block name="tableTopBtn"}
    <button class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del"><i class="layui-icon"></i></button>
{/block}

<!-- 行工具栏 -->
{block name="tableEndBtn"}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit"><i class="layui-icon"></i></a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon"></i></a>
{/block}

{block name="script"}
    <script>
        var editList = window.location.pathname;
        var editAdd = editList + "Add";
        var editDel = editList + "Del";
        var editUp = editList + "Up";
        views.setUrl(editAdd,editDel,editUp).cols({
            url:editList,
            page:true,
            cols: [
                {type: 'checkbox', fixed: 'left'}

                ,{field:'id', title:'ID', align:'center'}
                ,{field:'agency_user_p_nickname', title:'上级昵称', align:'center'}
                ,{field:'agency_user_p_type', title:'上级类型', align:'center'
                    ,templet:function(d)
                    {
                        console.log(d.agency_user_p_type);
                        return d.agency_user_p_type ? '代理' : '业务员' ; 
                    }
                }
                
                ,{field:'agency_user_nickname', title:'代理昵称', align:'center'}
                ,{field:'agency_user_name', title:'代理账号', align:'center'}
                ,{field:'agency_user_code', title:'代理邀请码', align:'center'}
                ,{field:'agency_user_check', title:'审核状态', align:'center'
                    ,templet:function(d)
                    {
                        if(d.agency_user_check == 0){
                            return "审核中";
                        }
                        if(d.agency_user_check == 1){
                            return "审核未通过";
                        }
                        if(d.agency_user_check == 2){
                            return "审核通过";
                        }
                    }
                }
                ,{field:'agency_user_is_show', title:'是否显示', align:'center' 
                    ,templet:function(d)
                    {
                       return d.agency_user_is_show ? '是' : '否' ;
                    }
                }
                ,{field:'agency_user_times', title:'添加时间', align:'center', templet:function(d){ return d.agency_user_times ? layui.util.toDateString(d.agency_user_times * 1000) : '' ; }}

                ,{fixed: 'right', title:'操作', toolbar: '#test-table-toolbar-barDemo', width:150}
            ]

        }).toolbar(function(obj,data,table){
            // 头工具栏事件

        }).tool(function(obj,table){
            //监听行工具事件

        }).get();
    </script>
{/block}